package com.artist.service.Impl;

import com.artist.entity.TbCate;
import com.artist.mapper.CateMapper;
import com.artist.service.CateService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service("cateService")
public class CateServiceImpl implements CateService {
    @Autowired
    private CateMapper cateMapper;
    @Override
    public List<TbCate> allCate() {
        return cateMapper.selectAll();
    }

    @Override
    public void saveCate(TbCate tbCate) {
        cateMapper.insertSelective(tbCate);

    }

    @Override
    public void updateCate(TbCate tbCate) {
        cateMapper.updateByPrimaryKeySelective(tbCate);

    }

    @Override
    public TbCate selectByPrimaryKey(Long cateId) {
        return cateMapper.selectByPrimaryKey(cateId);
    }

    @Override
    public void deleteCate(Long cateId) {
        cateMapper.deleteByPrimaryKey(cateId);

    }

}
